<template>
  <div style="padding: 30px">
    <el-form ref="form" :model="form">
      <div class="sad" style="margin: 10px 0; display: flex">
        <div><i class="el-icon-edit" style="color: #409eff"></i> 报表日期</div>
      </div>
      <div style="display: flex; margin-top: 10px">

        <el-form-item label="年份" style="display: flex;width: 30%;">
          <el-select v-model="form.year" placeholder="请选择年份" clearable :style="{width: '100%'}">
            <el-option v-for="(item, index) in dict.type.year_type" :key="index" :label="item.label"
                       :value="item.value" :disabled="item.disabled"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="月份" style="display: flex;width: 30%;">
          <el-select v-model="form.month" placeholder="请选择月份" clearable :style="{width: '100%'}">
            <el-option v-for="(item, index) in dict.type.month_type" :key="index" :label="item.label"
                       :value="item.value" :disabled="item.disabled"></el-option>
          </el-select>
        </el-form-item>
        <!--        <el-form-item label="报表名称" style="width: 70%;" >-->
        <!--          <el-input-->
        <!--            v-model="form.itemName"-->
        <!--            autocomplete="off"-->
        <!--            style="width: 70%"-->
        <!--          ></el-input>-->
        <!--        </el-form-item>-->
      </div>

      <div class="sad" style="margin: 10px 0; display: flex">
        <div><i class="el-icon-edit" style="color: #409eff"></i> 形象进展</div>
      </div>
      <el-form-item label="形象进展">
        <el-checkbox-group v-model="form.imagePlan" size="medium">
          <el-checkbox v-for="(item, index) in dict.type.plan_type" :key="index" :label="item.value"
                       :disabled="item.disabled" border>{{ item.label }}
          </el-checkbox>
        </el-checkbox-group>
      </el-form-item>
      <!-- 生产产值 -->
      <div class="sad">
        <i class="el-icon-edit" style="color: #409eff"></i> 生产产值
      </div>
      <div style="display: flex; margin-top: 10px">
        <el-form-item label="本月产值" style="display: flex">
          <el-input v-model="form.monthMoney" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="开工后累计产值"
          style="display: flex; margin-left: 10px"
        >
          <el-input v-model="form.allMoney" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="本月职工人数"
          style="display: flex; margin-left: 10px"
        >
          <el-input v-model="form.staffQuantity" style="width: 150px"
          >
            <template slot="append">人</template>
          </el-input
          >
        </el-form-item>
        <el-form-item label="人均产值" style="display: flex; margin-left: 10px">
          <el-input v-model="form.capite" style="width: 150px"
          >
            <template slot="append">万元/人</template>
          </el-input
          >
        </el-form-item>
      </div>
      <!-- 财务收支 -->
      <div class="sad" style="margin-top: 0px">
        <div><i class="el-icon-edit" style="color: #e6a23c"></i> 财务收支</div>
      </div>
      <div style="display: flex; margin-top: 10px">
        <el-form-item
          label="合同节点应收账款"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.node" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="本月支付劳务款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.labour" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="开工后累计支付劳务款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.allLabour" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="累计外欠劳务款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.waiqianLabour" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="业主累计已付款"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.ownerPay" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="本月支付材料款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.materials" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="开工后累计支付材料款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.allMaterials" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="累计外欠材料款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.waiqianMaterials" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="业主累计欠付款"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.ownerBackPay" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="本月支付租赁款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.materialsPay" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="开工后累计支付租赁款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.allLease" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="累计外欠租赁款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.waiqianLease" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item label="质保金" class="item_list" style="display: flex">
          <el-input v-model="form.warranty" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="本月支付其他款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.payOther" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="开工后累计支付其他款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.allOther" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="累计外欠其他款"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.waiqianOther" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="本月已到节点未计价"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.nodeNo" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="本月向业主开具发票"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.ownerInvoice" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="开工后累计向业主开具发票"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.allOwnerInvoice" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
      </div>
      <!-- 直接经营 -->
      <div class="sad" style="margin-top: 0px">
        <div><i class="el-icon-edit" style="color: #e6a23c"></i> 直接经营</div>
      </div>
      <div style="display: flex; margin-top: 10px">
        <el-form-item
          label="管理人员工资"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.staffWage" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="通行费"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.goThrough" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="钢筋进场"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.rebarApproach" style="width: 150px"
          >
            <template slot="append">吨</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="钢筋损耗率"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.rebarAttrition" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="生产例会"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.productionMeeting" style="width: 150px"
          >
            <template slot="append">次</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="处理钢材废品"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.rebarWaste" style="width: 150px"
          >
            <template slot="append">吨</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="业务招待费"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.businessServe" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="运费"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.freight" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="混凝土进场"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.betonApproach" style="width: 150px"
          >
            <template slot="append">m³</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="模板损耗率"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.betonAttrition" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="原材送检"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.materialInspect" style="width: 150px"
          >
            <template slot="append">次</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="处理木材废品"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.woodWaste" style="width: 150px"
          >
            <template slot="append">元</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="业务协调费"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.businessCoordinate" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="勤杂工"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.oddJobmen" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="砂浆进场"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.mortarApproach" style="width: 150px"
          >
            <template slot="append">吨</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="方木损耗率"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.woodAttrition" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="专题论证会"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.topicArgument" style="width: 150px"
          >
            <template slot="append">次</template>
          </el-input
          >
        </el-form-item>
        <el-form-item class="item_list" label=""></el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="车辆燃油费"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.fuelCost" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="非生产区用电"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.noElectricity" style="width: 150px"
          >
            <template slot="append">度</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="模板进场"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.templateApproach" style="width: 150px"
          >
            <template slot="append">张</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="钢管损耗率"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.steelAttrition" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="监理通知单"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.supervisorInform" style="width: 150px"
          >
            <template slot="append">次</template>
          </el-input
          >
        </el-form-item>
        <el-form-item class="item_list" label=""></el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item label="伙食费" class="item_list" style="display: flex">
          <el-input v-model="form.food" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="生产区用电"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.electricity" style="width: 150px"
          >
            <template slot="append">度</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="方木进场"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.woodApproach" style="width: 150px"
          >
            <template slot="append">根</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="扣件损耗率"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.fasteningAttrition" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="劳务通知单"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.labourInform" style="width: 150px"
          >
            <template slot="append">次</template>
          </el-input
          >
        </el-form-item>
        <el-form-item class="item_list" label=""></el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item label="办公费" class="item_list" style="display: flex">
          <el-input v-model="form.work" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="钢构件进场"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.steelMember" style="width: 150px"
          >
            <template slot="append">吨</template>
          </el-input
          >
        </el-form-item>
      </div>
      <!-- 二次经营 -->
      <div class="sad" style="margin-top: 0px">
        <div><i class="el-icon-edit" style="color: #e6a23c"></i> 二次经营</div>
      </div>
      <div style="display: flex; margin-top: 10px">
        <el-form-item
          label="本月变更索赔"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.changeClaim" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="已批复"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.changeReply" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="占本月产值"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.changeValue" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="本月材料价差签证"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.materialsSpread" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="已批复"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.spreadReply" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="占本月产值"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.spreadValue" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="本月停工、窝工索赔"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.lockoutClaim" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="已批复"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.lockoutReply" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="占本月产值"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.lockoutValue" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="本月保险理赔"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.insuranceClaim" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="已批复"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.insuranceReply" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="占本月产值"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.insuranceValue" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
      </div>
      <!-- 合同签订 -->
      <div class="sad" style="margin-top: 0px">
        <div><i class="el-icon-edit" style="color: #67c23a"></i> 合同签订</div>
      </div>
      <div style="display: flex; margin-top: 10px">
        <el-form-item
          label="应签合同总数量"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.oughtSigned" style="width: 150px"
          >
            <template slot="append">个</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="新进入劳务班组数量"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.newLabour" style="width: 150px"
          >
            <template slot="append">个</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="已签合同数量"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.signed" style="width: 150px"
          >
            <template slot="append">个</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="未签合同数量"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.notSigned" style="width: 150px"
          >
            <template slot="append">个</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="合同签订率"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.contractRate" style="width: 150px"
          >
            <template slot="append">%</template>
          </el-input
          >
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          class="item_list"
          label="已进场未签合同数量"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.courseNot" style="width: 150px"
          >
            <template slot="append">个</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="中途撤场、清退班组数量"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.inWithdrawal" style="width: 150px"
          >
            <template slot="append">个</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="退场原因及损失说明:"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input
            type="textarea"
            v-model="form.withdrawalCause"
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item
          label="未签合同原因说明:"
          class="item_list"
          type="textarea"
          style="display: flex; margin-left: 5px"
        >
          <el-input
            type="textarea"
            v-model="form.notSignedCause"
            style="width: 200px"
          ></el-input>
        </el-form-item>
      </div>
      <!-- 安全质量 -->
      <div class="sad" style="margin-top: 0px">
        <div><i class="el-icon-edit" style="color: #67c23a"></i> 安全质量</div>
      </div>
      <div style="display: flex; margin-top: 10px">
        <el-form-item
          label="安全隐患（事故）"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.safety" style="width: 150px"
          >
            <template slot="append">起</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="造成损失"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.safetyLoss" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="存在的主要问题"
          style="display: flex; margin-left: 5px"
        >
          <el-input
            v-model="form.safetyIssue"
            type="textarea"
            style="width: 200px"
          ></el-input>
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="质量隐患（事故）"
          class="item_list"
          style="display: flex"
        >
          <el-input v-model="form.quality" style="width: 150px"
          >
            <template slot="append">起</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          label="造成损失"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.qualityLoss" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="存在的主要问题"
          style="display: flex; margin-left: 5px"
        >
          <el-input
            v-model="form.qualityIssue"
            type="textarea"
            style="width: 200px"
          ></el-input>
        </el-form-item>
      </div>
      <!-- 固定资产投入/安全文明投入 -->
      <div class="sad" style="margin-top: 0px">
        <div>
          <i class="el-icon-edit" style="color: #e6a23c"></i>
          固定资产投入/安全文明投入
        </div>
      </div>
      <div style="display: flex; margin-top: 10px">
        <el-form-item
          label="固定资产投入"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.fixedProperty" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="其中："
          style="display: flex; margin-left: 5px"
        >
          <el-input
            v-model="form.fixedIn"
            type="textarea"
            style="width: 100%"
          ></el-input>
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="安全文明投入"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.safetyInto" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="其中："
          style="display: flex; margin-left: 5px"
        >
          <el-input
            v-model="form.safetyIn"
            type="textarea"
            style="width: 100%"
          ></el-input>
        </el-form-item>
      </div>
      <!-- 工程量节与超/成本节约/额外创收 -->
      <div class="sad" style="margin-top: 0px">
        <div>
          <i class="el-icon-edit" style="color: red"></i>
          工程量节与超/成本节约/额外创收
        </div>
      </div>
      <div style="display: flex; margin-top: 10px">
        <el-form-item
          label="工程量节与超"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.engineer" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="其中："
          style="display: flex; margin-left: 5px"
        >
          <el-input
            v-model="form.engineerIn"
            type="textarea"
            style="width: 100%"
          ></el-input>
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="成本节约"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.costEconomy" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="其中："
          style="display: flex; margin-left: 5px"
        >
          <el-input
            v-model="form.costIn"
            type="textarea"
            style="width: 100%"
          ></el-input>
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="额外创收"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.extraCreate" style="width: 150px"
          >
            <template slot="append">万元</template>
          </el-input
          >
        </el-form-item>
        <el-form-item
          class="item_list"
          label="其中："
          style="display: flex; margin-left: 5px"
        >
          <el-input
            v-model="form.createIn"
            type="textarea"
            style="width: 100%"
          ></el-input>
        </el-form-item>
      </div>
      <!-- 风险预警 -->
      <div class="sad" style="margin-top: 0px">
        <div><i class="el-icon-edit" style="color: #f56c6c"></i> 风险预警</div>
      </div>
      <div style="display: flex; margin-top: 10px">
        <el-form-item
          label="工期风险"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.workPeriodRisk" style="width: 600px"></el-input>
        </el-form-item>
        <el-form-item
          label="法律风险"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.lawRisk" style="width: 600px"></el-input>
        </el-form-item>
      </div>
      <div style="display: flex">
        <el-form-item
          label="审计风险"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.auditRisk" style="width: 600px"></el-input>
        </el-form-item>
        <el-form-item
          label="结算风险"
          class="item_list"
          style="display: flex; margin-left: 5px"
        >
          <el-input v-model="form.settlementRisk" style="width: 600px"></el-input>
        </el-form-item>
      </div>
      <el-form-item label="其他风险" style="display: flex; margin-left: 5px">
        <el-input v-model="form.otherRisk" style="width: 600px"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="close">关闭</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import {getItemReport, addItemReport, updateItemReport} from "@/api/report/itemReport";
import {getItem} from "@/api/base/item";

export default {
  dicts: ['plan_type', 'year_type', 'month_type'],
  components: {},
  props: [],
  data() {
    return {
      form: {
        imagePlan: [],
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
      },
    };
  },
  computed: {},
  watch: {},
  created() {
  },
  mounted() {
    console.log(this.$route.query.itemId)
    if (this.$route.query.itemId) {
      this.getItem(this.$route.query.itemId)
    }
    if (this.$route.query.id) {
      this.getItemReport(this.$route.query.id)
    }


  },
  methods: {
    getItemReport(id) {
      getItemReport(id).then(response => {
        console.log(response.data)
        var data = response.data;
        var imagePlan = data.imagePlan;
        if (null != imagePlan&&""!=imagePlan) {
          data.imagePlan=imagePlan.split(",")
        }
        this.form = response.data
      });
    },
    /** 获取报表信息 */
    getItem(id) {
      getItem(id).then(response => {
        console.log(response.data)
        this.form.itemId = response.data.id
        this.form.itemName = response.data.name
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          var form = this.form
          if (null == form.year || "" == form.year) {
            this.$modal.msgError("请选择年份")
            return false;
          }
          if (null == form.month || "" == form.month) {
            this.$modal.msgError("请选择月份")
            return false;
          }
          if (null != form.imagePlan && 0<form.imagePlan.length) {
            var planSTR=""
            var imagePlan=form.imagePlan
            for (let i = 0; i < imagePlan.length; i++) {
              if (0 != i) {
                planSTR+=","+imagePlan[i]
                continue;
              }
              planSTR+=imagePlan[i]
            }
            form.imagePlan=planSTR
          }
          if (form.id != null) {
            updateItemReport(form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.close()
            });
          } else {
            addItemReport(form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.close()
            });
          }
        }
      });
    },
    close() {
      let redictUrl = '/report/itemReport';
      this.$store.dispatch("tagsView/delView", this.$route);
      this.$router.push({path: redictUrl, query: {t: Date.now()}})
    }
  },
};
</script>
<style rel="stylesheet/scss" lang="scss">
.sad {
  width: 100%;
  height: 30px;
  line-height: 30px;
  margin-top: -15px;
  color: #303133;
  background-color: #f2f6fc;
  font-weight: bold;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.item_list {
  flex: 1;
  text-align: center;
}
</style>
